<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('gift/index')}">礼物列表</a></li>
			<li><a href="{:url('gift/add')}">礼物添加</a></li>
		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('gift/index')}">
			礼物名称:
			<input type="text" class="form-control" name="g_name" value="{$g_name}" placeholder="请输入礼物名称">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:url('gift/index')}">清空</a>
		</form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>礼物名称</th>
					<th>赞助商</th>
					<th>兑换密码</th>
					<th>联系电话</th>
					<th>礼品总数</th>
					<th>已使用数</th>
					<th>添加日期</th>
					<th>有效期</th>
					<th width="130">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="shout" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td><a href='{:url("gift/annal",array("id"=>$vo["id"]))}' title="下发记录">{$vo.g_name}</a></td>
					<td><a href="{$vo.g_url}" title="兑奖网址" target="_blank">{$vo.g_sponsor}</a></td>
					<td>{$vo.g_password}</td>
					<td>{$vo.g_phone}</td>
					<td>{$vo.g_total}</td>
					<td>{$vo.g_use}</td>
					<td>{$vo.g_addtime}</td>
					<td>{$vo.g_validtime}</td>
					<td>
						<a href='{:url("gift/edit",array("id"=>$vo["id"]))}'>编辑</a> |
						<if condition="$vo['g_status'] eq 10">
							<a href="{:url('gift/enabled',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要停用此礼物吗？">停用</a> |
							<a href="{:url('gift/issued',array('id'=>$vo['id']))}">下发</a>
							<else />
							<a href="{:url('gift/enabled',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要启用此礼物吗？"><b style="color: red">启用</b></a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>